package com.xdog.web3.controller.twitter;

import com.xdog.common.core.domain.R;
import com.xdog.web3.domain.twitter.TwitterFollowUser;
import com.xdog.web3.service.twitter.ITwitterFollowUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.List;

/**
 * Twitter关注用户Controller
 */
@Slf4j
@Tag(name = "Twitter关注用户", description = "Twitter关注用户相关接口")
@RestController
@RequestMapping("/web3/twitter/follow")
public class TwitterFollowUserController {

    @Autowired
    private ITwitterFollowUserService twitterFollowUserService;

    @Autowired
    private com.xdog.web3.service.impl.twitter.TwitterFollowDataServiceImpl twitterFollowDataService;

    /**
     * 获取所有关注用户
     * @return 关注用户列表
     */
    @Operation(summary = "获取所有关注用户", description = "获取所有Twitter关注用户信息")
    @GetMapping("/list")
    public R<List<TwitterFollowUser>> getAllFollowUsers() {
        try {
            List<TwitterFollowUser> users = twitterFollowUserService.getAllFollowUsers();
            return R.ok(users);
        } catch (Exception e) {
            log.error("获取Twitter关注用户列表失败", e);
            return R.fail("获取关注用户列表失败");
        }
    }
}
